﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Configuration;
using System.Configuration.Provider;
using Core.CMS.Providers;
using Core.DMS.Providers;

namespace Core.Configuration
{
    

    public class ProviderConfigCollection : ProviderCollection
    {
        public new AppFunctionProvider this[string name]
        {
            get { return (AppFunctionProvider)base[name]; }
        }

        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (!(provider is ContentProvider))
                throw new ArgumentException ("Invalid provider type", "provider");

            base.Add(provider);
        }
    }
}
